﻿// -------------------------------------------------------------------------
//    @FileName         :    NFOnlineModule.cpp
//    @Author           :    gaoyi
//    @Date             :    2025-04-02
//    @Email			:    445267987@qq.com
//    @Module           :    NFOnlineModule
//
// -------------------------------------------------------------------------

#include "NFOnlineModule.h"

#include <NFPacketSendUtil.h>
#include <NFSession.h>
#include <NFSessionUtil.h>
#include "NFPlayerMgr.h"

NFOnlineModule::NFOnlineModule(NFIPluginManager* p): NFLogicDynamicModule(p)
{
}

NFOnlineModule::~NFOnlineModule()
{
}

int NFOnlineModule::Awake()
{
    return 0;
}

int NFOnlineModule::OnHandleServerMessage(uint32_t msgId, NFDataPackage& packet, uint64_t param1, uint64_t param2)
{
    if (!m_pObjPluginManager->IsInited(NF_ST_LOGIC_SERVER))
    {
        NFLogError(NF_LOG_DEFAULT, packet.nParam1, "Logic Server not inited, drop client msg:{}", packet.ToString());
        return -1;
    }

    if (m_pObjPluginManager->IsServerStopping())
    {
        NFLogError(NF_LOG_DEFAULT, packet.nParam1, "Logic Server is Stopping, drop client msg:{}", packet.ToString());
        return proto_ff::ERR_CODE_SERVER_IS_STOPPING;
    }

    int iRetCode = 0;
    switch (packet.nMsgId)
    {
        default:
            NFLogError(NF_LOG_DEFAULT, 0, "not handle msg:{}", packet.nMsgId);
    }

    return iRetCode;
}



